#region Using directives

using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using System.Xml;
using MCMLXVII.BackEnd.Services.Common.Messages;
using MCMLXVII.Core.Common;

#endregion

namespace MCMLXVII.BackEnd.Services.OrganizationChart.Messages.AdvancedFind
{
    [Serializable()]
    [System.Xml.Serialization.XmlType(Namespace = "http://tempuri.org/")]
    public class msgOrganizationMemberFind
    {

        private bool _IncludeGroups;

        public bool IncludeGroups
        {
            get { return _IncludeGroups; }
            set { _IncludeGroups = value; }
        }
        private bool _IncludeFinalUsers;

        public bool IncludeFinalUsers
        {
            get { return _IncludeFinalUsers; }
            set { _IncludeFinalUsers = value; }
        }
        private bool _IncludeRoles;

        public bool IncludeRoles
        {
            get { return _IncludeRoles; }
            set { _IncludeRoles = value; }
        }
        private bool _IncludeSecuritySelectables;

        public bool IncludeSecuritySelectables
        {
            get { return _IncludeSecuritySelectables; }
            set { _IncludeSecuritySelectables = value; }
        }
        private bool _IncludeNodes;

        public bool IncludeNodes
        {
            get { return _IncludeNodes; }
            set { _IncludeNodes = value; }
        }

        private FilterItem[] _Filter;
        public FilterItem[] Filter
        {
            get
            {
                return _Filter;
            }
            set
            {
                _Filter = value;
            }
        }


        public void AddFilter(string PropertyName, string Value)
        {
            FilterItem[] TF = new FilterItem[_Filter.Length + 1];
            Array.Copy(_Filter, TF, _Filter.Length);
            _Filter = TF;
            _Filter[_Filter.Length - 1] = new FilterItem(PropertyName, Value);        
        }
        
        private int _HeadNodeID;
        public int HeadNodeID
        {
            get
            {
                return _HeadNodeID;
            }
            set
            {
                _HeadNodeID = value;
            }
        }

        public msgOrganizationMemberFind()
        {

        }

        public msgOrganizationMemberFind(int HeadNodeID, FilterItem[] Filter, bool IncludeGroups, bool IncludeFinalUsers, bool IncludeRoles, bool IncludeSecuritySelectables, bool IncludeNodes)
        {
            _Filter = Filter;
            _HeadNodeID = HeadNodeID;
            _IncludeFinalUsers = IncludeFinalUsers;
            _IncludeGroups = IncludeGroups;
            _IncludeNodes = IncludeNodes;
            _IncludeRoles = IncludeRoles;
            _IncludeSecuritySelectables = IncludeSecuritySelectables;
        }
    }

}
